package xcmg.device.infra.enums;

/**
 * Created by sqq on 2018/1/30.
 */
public class CompanyTypeEnum {
    public static  enum Type{
        Name("QYLX"), //数据字典名称
        Company("1"), //核心企业
        Dealer("2"), //代理商
        Supplier("3"), //供应商
        Carrier("4"); //承运商
        private final String text;

        private Type(final String text){
            this.text=text;
        }
        @Override
        public String toString(){
            return text;
        }
    }

    public enum Channel {
        PlatformInsert(0, "平台录入"),
        PlatformRegister(1, "平台邀请"),
        Unknown(2,"未知");

        private String desc;
        private int code;
        Channel(int code,String desc){
            this.desc = desc;
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public int getCode() {
            return code;
        }
        //通过value获取对应的枚举对象
        public static Channel getExamType(int value) {
            for (Channel examType : Channel.values()) {
                if (value == examType.getCode()) {
                    return examType;
                }
            }
            return null;
        }
    }
}
